/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#ifndef PLIRQ_HANDLER_H
#define PLIRQ_HANDLER_H

#include <machine/pc/processor/interrupthandler.h>

/**
 * Abstract base class for all irq-handlers. All irq-handlers must
 * be derived from this class.
 */
class PLIrqHandler {
public:
	/**
	 * Called when the handler is registered with the irq manager and the irq occurred.
	 * @note If this function returns false you have to call IrqManager::acknowledgeIrq() when
	 * you removed the interrupt reason.
	 *
	 * @param number the irq number.
	 * @return should return true, if the interrupt reason was removed, or false otherwise.
	 */
	virtual bool irq(uint8_t number, InterruptState &state) = 0;
protected:
	/**
	 * Virtual destructor.
	 */
	inline virtual ~PLIrqHandler() {}
};

#endif
